package com.chen.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

//这个注解的意思，说明这个类被Spring接管了，即注册到了容器中
@Component
public class User {
    private int id;

    public int getId() {
        return id;
    }

    //属性注入值
    @Value("12")
    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                '}';
    }
}
